#!/bin/bash

MLC_TMP_CURRENT_SCRIPT_PATH=${MLC_TMP_CURRENT_SCRIPT_PATH:-$PWD}

# connect MLC intelligent components with CK env
export MLC_ML_TORCH_MODEL_NAME=resnet50
export MLC_ML_MODEL_INPUT_DATA_TYPE=float32
export MLC_ML_MODEL_IMAGE_HEIGHT=224
export MLC_ML_MODEL_IMAGE_WIDTH=224
export MLC_DATASET_IMAGENET_PREPROCESSED_DIR=${MLC_DATASET_PREPROCESSED_FULL_PATH}
export MLC_CAFFE_IMAGENET_SYNSET_WORDS_TXT=${MLC_DATASET_AUX_PATH}/synset_words.txt
export MLC_DATASET_IMAGENET_PREPROCESSED_DATA_TYPE=float32
export MLC_RESULTS_DIR=${MLC_TMP_CURRENT_SCRIPT_PATH}/results
export ML_MODEL_DATA_LAYOUT=NCHW

${MLC_PYTHON_BIN} -m pip install -r ${MLC_TMP_CURRENT_SCRIPT_PATH}/requirements.txt
test $? -eq 0 || exit 1

${MLC_PYTHON_BIN} ${MLC_TMP_CURRENT_SCRIPT_PATH}/src/pytorch_classify_preprocessed.py
test $? -eq 0 || exit 1
